Cover TOC Chap Prev Chap Prev Fig Next Fig Next Chap

Chapter 18: Controlling Texture Mapping

../ch18/18fig20b.gif
Figure 18.20b

A pizza texture with a slice selected mapped to a triangular face.

18fig20b.wrl
Click on the image to view the VRML scene.

#VRML V2.0 utf8
# The VRML 2.0 Sourcebook
# Copyright (c) 1997
# Andrea L. Ames, David R. Nadeau, and John L. Moreland
Shape {
    appearance Appearance {
        material Material { }
        texture ImageTexture {
            url "pizza.jpg"
        }
    }
    geometry IndexedFaceSet {
        coord Coordinate {
            point [
            # Slice, pulled out of pizza
                0.50 0.0 0.50,   0.88 0.0 1.42,
                1.06 0.0 1.33,   1.21 0.0 1.21,
                1.33 0.0 1.06,   1.42 0.0 0.88
            ]
        }
        coordIndex [ 0, 1, 2, 3, 4, 5 ]
        texCoord TextureCoordinate {
            point [
            # Center point of pizza image
                0.50 0.50,
            # Slice perimeter
                0.68 0.07,  0.76 0.11,
                0.83 0.17,  0.89 0.24,
                0.93 0.32,
            ]
        }
        texCoordIndex [ 0, 1, 2, 3, 4, 5, ]
        solid FALSE
    }
}